<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>关注</title>
		<script src="html5plus://ready"></script>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css" />
		<script src="../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="../../css/my/fans.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">我的关注</h1>
		</header>
		<div class="mui-content">
			<div v-if=" items.length == 0" class="heroism-box">
				<div class="no_box">
					<!--<img src="../img/icon_memeda.png" />-->
					<p>你还没有关注过哦！</p>
				</div>
			</div>
			<ul v-else class="mui-table-view">
				<li v-for="(item,index) in items" :data-id="item.user_id" :id="item.user_id" @click.stop="opendetails(item.user_id,item.nick_name,item.headimg)" class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" :src="item.headimg">
						<div class="mui-media-body">
							{{item.nick_name}}

						</div>
						<div class="close_guan" @click.stop="offGuan(index)">
							<img src="../../img/my/Mycare.png" />
							<span>已关注</span>
						</div>
					</a>
				</li>
			</ul>
		</div>
		<script src="../../js/md5.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/function.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var Qurl = getApiUrl('http://www.jiaoyou0.cn', 'follow/delFollow');
			var news = new Vue({
				el: '.mui-content',
				data: {
					items: []
				},
				methods: {
					opendetails: function(ii, title, headimg) {
						openPersonalBlog(ii, headimg, title);
					},
					offGuan: function(ii) {
						var btnArray = ['确定', '取消'];
						mui.confirm(' ', '取消关注', btnArray, function(e) {
							if(e.index == 0) {
								mui.ajax({
									type: "post",
									url: Qurl,
									async: true,
									dataType: 'json',
									data: {
										'user_id': configs.user_id,
										'follow_uid': news.items[ii].user_id
									},
									success: function(data) {
										news.items.splice(ii, 1);
									}
								})
							}
						})

					}
				}
			});
			var furl = getApiUrl('http://www.jiaoyou0.cn', 'follow/listFollow');
			mui.getJSON(furl, {
				'user_id': configs.user_id,
				'type': 1
			}, function(rsp) {
				news.items = rsp.data;
			});
		</script>
	</body>

</html>